GH-4468: Fix no-op ack detection for non-null Acknowledgment#4470
Open
abhimoondra wants to merge 1 commit into
Open
GH-4468: Fix no-op ack detection for non-null Acknowledgment#4470abhimoondra wants to merge 1 commit into
abhimoondra wants to merge 1 commit into
Conversation
…dgment The built-in DLT logging handler declares its Acknowledgment parameter with the JSpecify @nonnull, which is a TYPE_USE annotation that MethodParameter.getParameterAnnotation() does not see. So noOpAck stayed false and, under a non-manual ack mode, DLT consumption failed with "No Acknowledgment available ... MANUAL AckMode". Use Nullness.forMethodParameter() instead, which understands TYPE_USE and @NullMarked nullness. Add a test for the non-null case. Signed-off-by: Abhishek Moondra <abhishek.moondra@sixt.com>
artembilan
requested changes
Jun 5, 2026
Member
artembilan
left a comment
There was a problem hiding this comment.
LGTM!
Please, add your name to the @author list of all the affected classes.
Thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4468.
The built-in DLT logging handler
LoggingDltListenerHandlerMethod.logMessage(Object, @NonNull Acknowledgment)stopped working under a non-manual ack mode on 4.0. Its@NonNullis now the JSpecify@NonNull(aTYPE_USEannotation), whichMethodParameter.getParameterAnnotation()doesn't return, sonoOpAckstayedfalseand the DLT consumer failed withNo Acknowledgment available ... MANUAL AckModeand re-published the record to the same DLT in a loop.Switched the check in
MessagingMessageListenerAdapter.determineInferredTypetoNullness.forMethodParameter()(per the suggestion on the issue), which understandsTYPE_USEand@NullMarkednullness.Also added a test covering the non-null
Acknowledgmentparameter case, which wasn't covered before.